import request from "@/services/request";
// import { extend } from '@/services/request';

import { RUC_SERVICE, ACE_OUTCALL } from "@/services/constant";

interface IAuthInfo {
  url: string;
  appKey?: string;
  sign?: string;
}

/**
 * 获取数据
 * @param autoInfo
 * @param params
 */
export const GetDataByExternalUrl = async (
  autoInfo: IAuthInfo,
  params: any
) => {
  console.log("autoInfo-------------{}", autoInfo, params);
  const res = await request(`${ACE_OUTCALL}/control/getControlGroupInfo`, {
    method: "POST",
    data: { ...autoInfo, data: params },
  });

  return res.data;
};
/**
 * 获取数据
 * @param autoInfo
 * @param params
 */
export const GetDataByExternalUrlR = async (url: string, params: any) => {
  const res = await request(RUC_SERVICE + url, {
    method: "POST",
    data: params,
  });

  return res.data;
};
